class Explosion extends Animation {
    private byte type;
    public byte state;
    public int x, y;
    public boolean reserved;
   
    Explosion() {
        state = Constants.EXPLOSION_STATE_FINISHED;
        reserved = false;
    }

    public boolean isFinished() {
        return state == Constants.EXPLOSION_STATE_FINISHED;
    }

    public void activate(byte type, int x, int y) {
        this.type = type;
        this.x = x;
        this.y = y;
        state = Constants.EXPLOSION_STATE_ACTIVE;
        startAnimation(type, Constants.ANIMATION_PLAY_ONCE);
    }

    public void update(long dt) {
        if ((state == Constants.EXPLOSION_STATE_ACTIVE) && updateAnimation(dt)) {
            state = Constants.EXPLOSION_STATE_FINISHED;
        }
    }
}